package ua.com.abakumov.android.prostopleer.engines

import android.os.AsyncTask
import ua.com.abakumov.android.prostopleer.util.Composition

/**
 *
 * User: aabakumov, Date: 18.12.12, Time: 19:25 
 */
abstract class Searcher(val completed: Completed) extends AsyncTask[String, String, Compositions] {
  protected def doSearch(text: String): List[Composition]

  override protected def doInBackground(p: String*): Compositions = {
    val searchText: String = p(0)
    val res: List[Composition] = doSearch(searchText)
    res

  }

  protected override def onPostExecute(result: Compositions) {
    //completed(result)
    //resultDone.done(result)
  }
}
